<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>南京大学职业咨询室预约平台</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='assets/i/ico_128X128.ico') }}">
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="apple-touch-icon-precomposed" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Tile icon for Win8 (144x144 + tile color) -->
    <meta name="msapplication-TileImage" content="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <meta name="msapplication-TileColor" content="#0e90d2">

    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/amazeui.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/app.css', v='1.4') }}">
    <script src="{{ url_for('static', filename='assets/js/jquery.min.js') }}"></script>
    <script src="{{ url_for('static', filename='assets/js/amazeui.min.js') }}"></script>
    <style type="text/css">
    .tocenter {
        margin: 0 auto;
        text-align: center;
    }

    .am-cf {
        text-align: center;
        float: none;
    }

    .am-g p {
        text-align: center;
        font-size: 30px;
    }

    </style>
</head>

<body>
<div class="header">
    <!--<div class="header-back" onclick="history.back()">返回</div>-->
    <div class="header-title">我的预约</div>
</div>
<div class="content">
    <div class="alert alert-warning">
        {% with messages = get_flashed_messages() %}
        {% if messages %}
        <ul class=flashes>
            {% for message in messages %}
            <div class="am-alert am-alert-secondary" data-am-alert>
                <button type="button" class="am-close">&times;</button>
                <div style="text-align: center;">{{ message }}</div>
            </div>
            {% endfor %}
        </ul>
        {% endif %}
        {% endwith %}
    </div>
    <div class="content-title-1" id="curtch">
        你好，{{ name|safe }} 同学
    </div>
    {% for li in lists %}
    <div class="book-item-warp">
        <div class="book-item-title">
            <div class="fl"> <strong>预约序号：</strong>{{li['seq']}}</div>
        </div>
        <div class="book-item-line">
            <div class="fl"> <strong>教师姓名：</strong>{{ li['tchname'] }}</div>
        </div>
        <div class="book-item-line">
            <div class="fl"> <strong>咨询内容：</strong>{{li['content']}}</div>
        </div>
        <div class="book-item-line">
            <div class="fl"> <strong>咨询日期：</strong>{{li['date']}}</div>
        </div>
         <div class="book-item-line">
            <div class="fl"> <strong>需求：</strong>{{li['demands']}}</div>
        </div>
        <div class="book-item-line">
            <div class="fl"> <strong>反馈：</strong>{{li['feedback']}}</div>
        </div>
        <div class="book-item-line">
            <div class="fl"> <strong>预约状态：</strong>{{li['status']}}</div>
            <div class="fr"> 
            {% if li['cancel'] %}
            <button value="{{cont}}" recid="{{li['seq']}}" onClick="cancel_book(this.value,this)" class="am-btn am-btn-danger">取消预约</button>
            {% else %}
            {% endif %}
            </div>
        </div>
        {% if li['iscanl'] %}
        <div class="book-item-line">
            <div class="fl"> <strong>取消原因：</strong>{{li['canlres']|safe}}</div>
        </div>
        {% else %}
        {% endif %}
    </div>
     {% endfor %}

    <form name="njusub">
        {{ form.csrf_token }}
        <br>

        <div class="am-cf">
            <button type="submit" id="logout" name="logout" value="" class="am-btn am-btn-danger" onclick="logout_users()">退出登录</button>
        </div>
        
    </form>
</div>

<div class="footer">
    <ul>
        <li><a href="/get_teacher_schedule" class="footer-item">预约咨询</a></li>
        <li><a href="/urgent_booking" class="footer-item">紧急咨询</a></li>
        <li><a href="/student_query_login_student" class="footer-item on">我的预约</a></li>
        <li><a href="/get_consultant_story_page" class="footer-item">咨询室故事</a></li>
        <li><a href="/index" class="footer-item">返回首页</a></li>
    </ul>
</div>

<script type="text/javascript">

    function cancel_book(val, obj)
    {
        conf = window.confirm("确定取消？咨询开始前24小时内不予取消！");
        if (conf) {
            document.njusub.action="/get_student_cancel_page?cont="+val+"&yyseq="+$(obj).attr("recid");
            document.njusub.method="post";
            document.njusub.submit();
        }
    }

    function teacher_info()
    {
        document.njusub.action="/get_teacher_schedule";
        document.njusub.method="post";
        document.njusub.submit();
    }

    function logout_users(){
        document.njusub.action="/directed_logout_student";
        document.njusub.method="post";
        document.njusub.submit();
    }

</script>
</body>

</html>
